<%@ page language="java" import="java.util.*" pageEncoding="utf-8"%>
<%@ taglib uri="/struts-tags" prefix="s"%>
<%
String path = request.getContextPath();
String basePath = request.getScheme()+"://"+request.getServerName()+":"+request.getServerPort()+path+"/";
%>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>无标题文档</title>
<style type="text/css">
<!--
body {
    
	margin-left: 0px;
	margin-top: 0px;
	margin-right: 0px;
	margin-bottom: 0px;
}
.STYLE1 {font-size: 12px}
.STYLE3 {font-size: 12px; font-weight: bold; }
.STYLE4 {
	color: #03515d;
	font-size: 12px;
}
-->
</style>

<!-- Video -->
<link rel="stylesheet" href="common/html5-video/vendorstyle.css" />
<link rel="stylesheet" href="common/html5-video/demo1/style.css" />


<link rel="stylesheet" href="common/kindeditor-4.1.3/themes/default/default.css" />
<link rel="stylesheet" href="common/kindeditor-4.1.3/plugins/code/prettify.css" />
<script charset="utf-8" src="common/kindeditor-4.1.3/kindeditor.js"></script>
<script charset="utf-8" src="common/kindeditor-4.1.3/lang/zh_CN.js"></script>
<script charset="utf-8" src="common/kindeditor-4.1.3/plugins/code/prettify.js"></script>
	<script>
		KindEditor.ready(function(K) {
             var editor = K.editor({
			    cssPath : 'common/kindeditor-4.1.3/plugins/code/prettify.css',
				uploadJson : 'uploadDemoAction!uploadImage.action',
				fileManagerJson : 'common/kindeditor-4.1.3/jsp/file_manager_json.jsp',
					allowFileManager : true
				});
			  K('#upload_video_button').click(function() {
					editor.loadPlugin('image', function() {
						editor.plugin.imageDialog({
							showRemote : false,
							imageUrl : document.getElementById("versionInfo_downloadAddress").value,
							clickFn : function(url, title, width, height, border, align) {
								//K('#addressVideoUrl').val(url);
								var addressVideoUrl=document.getElementById("versionInfo_downloadAddress");
								addressVideoUrl.value=url;
								editor.hideDialog();
							}
						});
					});
				});
				K('#add_video_button').click(function() {
					editor.loadPlugin('image', function() {
						editor.plugin.imageDialog({
							imageUrl : document.getElementById("versionInfo_downloadAddress").value,
							clickFn : function(url, title, width, height, border, align) {
								//K('#addressVideoUrl').val(url);
								var addressVideoUrl=document.getElementById("versionInfo_downloadAddress");
								addressVideoUrl.value=url;
								editor.hideDialog();
							}
						});
					});
				});
				
		});
	</script>
    <script>
     function validateForm(){
     var localVar = document.getElementById("versionInfo_version");
      if(localVar.value.length<1)
       {
           alert("版本号格式不正确");
           localVar.focus();
           return false;
       }
      localVar = document.getElementById("versionInfo_downloadAddress");
      if(localVar.value.length<1)
       {
           alert("文件不能为空！");
           localVar.focus();
           return false;
       }
      localVar = document.getElementById("versionInfo_versionInfoTitle");
      if(localVar.value.length<1)
       {
           alert("文件名称不能为空！");
           localVar.focus();
           return false;
       }
       return true;  
       localVar = document.getElementById("versionInfo_description");
      if(localVar.value.length<1)
       {
           alert("描述信息不能为空！");
           localVar.focus();
           return false;
       }
       return true;  
       
     }
    </script>
    
</head>

<body onload="document_onload();">
<table width="450" border="0" cellspacing="0" cellpadding="0" align="center" background="common/html5-video/bg.jpg">
  <tr><td>&nbsp;</td> </tr>
  <tr>
    <td height="30" background="tab/images/tab_05.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="30"><img src="tab/images/tab_03.gif" width="12" height="30" /></td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td width="80%" valign="middle"><table width="100%" border="0" cellspacing="0" cellpadding="0">
              <tr>
                <td width="5%"><div align="center"><img src="tab/images/tb.gif" width="16" height="16" /></div></td>
                <td width="100%" class="STYLE1"><div align="center">客户端版本发布</div></td>
              </tr>
            </table></td>
            <td width="54%">
			    &nbsp;
			</td>
          </tr>
        </table>

            
        <td width="16"><img src="tab/images/tab_07.gif" width="16" height="30" /></td>
      </tr>
    </table></td>
  </tr>
  <s:form  action="versionAction!versionAddSave.action" method="post" theme="simple" onsubmit="return validateForm();">
    <tr>
      <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="8" background=" tab/images/tab_12.gif">&nbsp;</td>
        <td>
		<table width="100%" border="0" cellpadding="0" cellspacing="1" bgcolor="b5d6e6" onmouseover="changeto()"  onmouseout="changeback()">
           
           <tr>          
            <td height="30" bgcolor="#FFFFFF"><div align="right"><span class="STYLE1">版本号</span></div></td>
            <td height="30" bgcolor="#FFFFFF"><span class="STYLE1"><div align="left"><s:textfield name="versionInfo.version"  id="versionInfo_version"  cssStyle="disabled:disabled; "/>(例：1.021)</div></span></td>
           </tr>
		    <tr>          
            <td height="30" bgcolor="#FFFFFF"><div align="right"><span class="STYLE1">更新等级</span></div></td>
            <td height="30" bgcolor="#FFFFFF"><div align="left"><span class="STYLE1"><s:radio list="#{'0':'普通升级','1':'紧级更新'}" name="versionInfo.level" /></span></div></td>
           </tr>
		    <tr>          
            <td height="30" bgcolor="#FFFFFF"><div align="right"><span class="STYLE1">客户端类型</span></div></td>
            <td height="30" bgcolor="#FFFFFF"><div align="left"><span class="STYLE1"><s:radio list="#{'0':'android客户端','1':'iphone客户端'}" name="versionInfo.customType"/></span></div></td>
           </tr>
           <tr>          
            <td height="30" bgcolor="#FFFFFF"><div align="right"><span class="STYLE1">安装文件</span></div></td>
            <td height="30" bgcolor="#FFFFFF"><div align="left"><s:textfield name="versionInfo.downloadAddress" id="versionInfo_downloadAddress" />&nbsp;<span class="STYLE1"><input type="button"  id="upload_video_button" value="上传文件"/>&nbsp;<input type="button" id="add_video_button" value="添加文件"/></span></div></td>
           </tr>
           <tr>          
            <td height="30" bgcolor="#FFFFFF"><div align="right"><span class="STYLE1">名称</span></div></td>
            <td height="30" bgcolor="#FFFFFF"><div align="left"><s:textfield name="versionInfo.versionTitle"  id="versionInfo_versionInfoTitle" />&nbsp;</div></td>
           </tr>
           <tr>          
            <td height="30" bgcolor="#FFFFFF"><div align="right"><span class="STYLE1">描述</span></div></td>
            <td height="30" bgcolor="#FFFFFF"><div align="left"><s:textarea rows="2" cols="40" name="versionInfo.description"    id="versionInfo_description"/>&nbsp;</div></td>
           </tr>
           <tr>          
            <td height="30" bgcolor="#FFFFFF"><div align="right"><span class="STYLE1">状态</span></div></td>
            <td height="30" bgcolor="#FFFFFF"><div align="left"><span class="STYLE1"><s:radio list="#{'0':'暂不发布','1':'发布'}" name="versionInfo.state"/></div></td>
           </tr>
		   <tr>          
            <td height="30" bgcolor="#FFFFFF" colspan="2"><div align="center"><input type="submit"  title="提交"/></div></td>
           </tr>
        </table>
       
        </td>
         </s:form>
        <td width="8" background="tab/images/tab_15.gif">&nbsp;</td>
      </tr>
    </table></td>
  </tr>
  
 <!-- <tr>&nbsp;</tr>-->
  <tr>
    <td height="35" background="tab/images/tab_19.gif"><table width="100%" border="0" cellspacing="0" cellpadding="0">
      <tr>
        <td width="12" height="35"><img src="tab/images/tab_18.gif" width="12" height="35" /></td>
        <td><table width="100%" border="0" cellspacing="0" cellpadding="0">
          <tr>
            <td class="STYLE4">&nbsp;&nbsp</td>
            <td><span class="STYLE1"></span>&nbsp;</td>
          </tr>
        </table></td>
        <td width="16"><img src="tab/images/tab_20.gif" width="16" height="35" /></td>
      </tr>
    </table></td>
  </tr>
</table>
</body>
</html>